package www;

import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;

/**
 * Creared with IntelliJ IDEA.
 * Description:顺序表的一些方法
 * User:yxd
 * Date:2022-01-03
 * Time:22:40
 */
class Student{
    private String name;
    private String classes;
    private double score;

    public Student(String name, String classes, double score) {
        this.name = name;
        this.classes = classes;
        this.score = score;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getClasses() {
        return classes;
    }

    public void setClasses(String classes) {
        this.classes = classes;
    }

    public double getScore() {
        return score;
    }

    public void setScore(double score) {
        this.score = score;
    }

    @Override
    public String toString() {
        return "Student{" +
                "name='" + name + '\'' +
                ", classes='" + classes + '\'' +
                ", score=" + score +
                '}';
    }
}
public class TestDemo {
    public static void main(String[] args) {
        String str1 = "welcome to bit";
        String str2 = "come";
        ArrayList<Character> list = new ArrayList<>();
        for (int i = 0; i < str1.length(); i++) {
            char s = str1.charAt(i);//转换为单个字符
            if(!str2.contains(s + "")){//str2里面是否  包含str1里面的有的话就不加 没有的话再放入
                list.add(s);
            }
        }

        for (char ch:list) {//遍历打印
            System.out.print(ch);
        }


        //System.out.println(str.contains(str1));

    }
    public static void main2(String[] args) {
        ArrayList<Integer> a = new ArrayList<>();//可以进行排序
        a.add(22);
        a.add(1);
        a.add(3);
        Collections.reverse(a);//颠倒
        System.out.println(a);
        Collections.sort(a);//排序
        System.out.println(a);
    }
    public static void main1(String[] args) {
        ArrayList<Student> students = new ArrayList<>();//这个里面也可以放自定义 数据类型
        students.add(new Student("yxd","2ban",98));
        students.add(new Student("hh","1ban",98.5));
        System.out.println(students);
    }
}
